<?php
use common\service\StaticService;
use common\service\GlobalUrlService;
use shopend\assets\ShopAsset;
StaticService::includeAppJsStatic(GlobalUrlService::buildShopStaticUrl('/backend/active/index.js'),ShopAsset::class);

?>

<div class="layui-card">
  <div class="layui-card-header">
    活动列表
  </div>
  <div class="layui-card-body">
    <form  class="layui-form" method="get" id="serch-form">
      <div class="layui-form-item">
        <div class="layui-inline">
          <label class="layui-form-label">活动名称</label>
          <div class="layui-input-inline">
            <input type="text" name="active_name"  autocomplete="off" class="layui-input">
            <input type="hidden" name="type" id="active_type" value="<?= $type?>"/>
          </div>
        </div>
        <div class="layui-inline">
          <span class="layui-btn" lay-submit lay-filter="serch-form"><i class="layui-icon">&#xe615;</i>搜索</span>
          <a href="<?= GlobalUrlService::buildShopUrl('active/add')?>" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe61f;</i>添加活动</a>
        </div>
      </div>

    </form>
    <table class="layui-hide" id="test"  lay-filter="barDemo"></table>

    <script type="text/html" id="header">
      <img src="{{d.avatarurl}}"/>
    </script>

    <script type="text/html" id="barDemo">
      <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
      {{# if(d.status == 0){ }}
      <a class="layui-btn layui-btn-xs" lay-event="start">激活</a>
      <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
      <a class="layui-btn layui-btn-xs" lay-event="del">删除</a>
      {{# }else if(d.status == 1){ }}
      <a class="layui-btn layui-btn-xs" lay-event="stop">暂停</a>
      {{# }else if(d.status == 2){ }}
      <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
      {{# } }}
      <a class="layui-btn layui-btn-xs" lay-event="qrcode">获取二维码</a>
    </script>
  </div>
  
</div>
